package com.example.dllo.baidumusic.fragment;
/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         佛祖保佑       永无BUG
*/

import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import com.example.dllo.baidumusic.R;
import com.example.dllo.baidumusic.adapter.MusicAdapter;
import com.example.dllo.baidumusic.nettool.BaseFragment;

import java.util.ArrayList;

/**
 * Created by dllo on 16/8/15.
 */
public class MusicLibraryFragment extends BaseFragment {

    private TabLayout musicTab;
    private ViewPager musicVper;


    @Override
    protected int setLayout() {
        return R.layout.fragment_musicku;
    }

    @Override
    protected void initView() {
        musicVper = bindView(R.id.music_library_viewpager);
        musicTab = bindView(R.id.music_library_tablayout);
    }

    @Override
    protected void initData() {
        MusicAdapter adapter = new MusicAdapter(getChildFragmentManager());
        ArrayList<Fragment> fragments = new ArrayList<>();
        fragments.add(new RecommendFragment());//推荐
        fragments.add(new LineFragment());//排行
        fragments.add(new MenuFragment());//歌单
        fragments.add(new TansceiverFragment());//电台
        fragments.add(new MVFragment());//MV

        adapter.setFragments(fragments);
        musicVper.setAdapter(adapter);
        musicTab.setupWithViewPager(musicVper);

    }
}
